<%--
  Created by IntelliJ IDEA.
  User: willy
  Date: 2022/4/7
  Time: 15:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.List,com.data.Course" %>
<%@ page import="com.data.page" %>
<html>
<head>
    <title>删除课程</title>
    <style>

        table{
            border: 1px black solid;
            width: 600px;
            border-collapse: collapse;
        }
        td,tr,th{
            border: 1px black solid;

        }
        a{
            text-decoration: none;

        }

    </style>
</head>
<body>

<%
    List<Course> courses = ((page)request.getSession().getAttribute("page")).getCourses();
    page p=(page)request.getSession().getAttribute("page");
%>
<form action="CourseController" method="post">
    <table >

        <tr align="center">
            <th></th>
            <th>序号</th>
            <th>课程名称</th>
            <th>选课人数</th>
            <th>课程性质</th>
        </tr>

        <%for (Course course : courses) {%>

        <tr align="center">
            <td><input type="checkbox" name="choose" value="<%=course.getCid()%>"/></td>
            <td><%=course.getCid()%></td>
            <td><%=course.getCname()%></td>
            <td><%=course.getCnum()%></td>
            <td><%=course.getCtype()%></td>
        </tr>

        <% } %>
    </table>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;
    <
    <a href="/Homework-920106840130/CourseController?pageNo=<%=p.getPageNo()-1%>">前页</a>
    <%for(int i=1;i<=p.getTotalPage();i++) {
        request.getSession().setAttribute("index",i);%>

    <a href="/Homework-920106840130/CourseController?pageNo=${sessionScope.index}"><%=i%></a>
    <% } %>
    <a href="/Homework-920106840130/CourseController?pageNo=<%=p.getPageNo()+1%>">后页</a>

    >
    <% request.getSession().setAttribute("course","delete");
    request.getSession().setAttribute("hitcourse","");%>
    </br></br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="删除课程" value="删除课程">
</form>
</body>
</html>
